# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/4/30 15:58
# 0. 导入需要的包和模块
from PyQt5.Qt import *
import sys

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)
window = QWidget()
# red = QWidget(window)
# red.resize(100,100)
# red.setStyleSheet("background-color:red;")


window.move(200, 100)
# window.resize(500, 500)
window.setFixedSize(500,500)

label = QLabel(window)
label.setText('飞虎哥')
label.move(100, 100)
label.setStyleSheet('background-color:cyan')


def changeCao():
	new_content = label.text() + '飞虎哥'
	label.setText(new_content)
	label.adjustSize()
	# label.resize(label.width() + 100, label.height())


btn = QPushButton(window)
btn.setText('增加内容')
btn.move(100, 300)
btn.clicked.connect(changeCao)

# window.setGeometry(0,0,150,150)


# print(window.x())
# print(window.width())
# print(window.geometry())

# 2.3 展示控件
window.show()
# window.setGeometry(0,0,150,150)


# print("="*20)
# print(window.x())
# print(window.width())
# print(window.geometry())
# 3. 应用程序的执行,进入到消息循环
sys.exit(app.exec_())
